package com.itheima.Thraed.CreateThread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class demo04 {
    public static void main(String[] args) {
        FutureTask<Integer> task = new FutureTask<>(new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                System.out.println("main thread started");
                Thread.sleep(2000);
                return 42;
            }
        }
        );
        new Thread(task).start();
    }
}
